<html xmlns:th="http://www.thymeleaf.org"  
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4"    
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">    
<html>
<head th:include="common/common::header">
<meta charset="UTF-8">

<style type="text/css">
#index {
	padding: 15px;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	opacity: 0;
	font-size: 12px;
}

.index-l {
	padding: 10px;
	width: 48%;
	overflow: auto;
}
</style>
</head>

<body>
	<div id="index">
		<form id="SysUserDtos_form" class="easyui-form" method="post" data-options="novalidate:true">
		<div class="contentWrapper">
			<!--tab-->
			<div class="index-l">
				<div id="tt" class="easyui-tabs" data-options="tabHeight:31"
					style="width: 100%;">
					<div title="基础信息" style="padding: 20px; display: none;">
						<div class="contentWrapper">
							<input type="hidden" id="sysUser_id" name="id" th:value="${SysUserDto.id }">
							<input type="hidden" id="sysUser_expired" name="expired" th:value="${SysUserDto.expired }">
							<input type="hidden" id="sysUser_head" name="head" th:value="${SysUserDto.head }">
							<div class="form-item">
								<label for="" class="label-top">用户名称：</label> <input
									id="sysUser_username" name="username" class="easyui-validatebox easyui-textbox"
									data-options="required:true" style="width:40%;"
									th:value="${SysUserDto.username }" readonly="readonly">
									
									<label for="" class="label-top" style="padding-left:2.5%">真实姓名：</label> <input id="sysUser_realname"
									class="easyui-validatebox easyui-textbox" name="realname"
									data-options="required:false" style="width: 40%;" th:value="${SysUserDto.realname }" readonly="readonly">

							</div>
							<br>
							<div class="form-item">
								<label for="" class="label-top">手机号码：</label> <input id="sysUser_phone"
									class="easyui-validatebox easyui-numberbox" validType='phoneNum' name="phone"
									data-options="required:true" style="width: 40%;"
									th:value="${SysUserDto.phone }" readonly="readonly">
									
								<label for="" class="label-top" style="padding-left:2.5%">电子邮件：</label> <input id="sysUser_email"
									class="easyui-validatebox easyui-textbox" name="email" validType='emailNum'
									data-options="required:false" style="width: 40%;" th:value="${SysUserDto.email }" readonly="readonly">
									

							</div>
							<br>
							<div class="form-item">
								<label for="" class="label-top">所属机构：</label> <input id="sysUser_orgid"
									class="easyui-validatebox easyui-combotree" name="orgid" 
									data-options="parentField:'pid',textField:'text',valueField:'id',editable:false,panelHeight:null,url:'/system/organization/load_pid.do'" style="width: 40%;" th:value="${SysUserDto.orgid }" readonly="readonly">

									<label for="" class="label-top" style="padding-left:2.5%">所属部门：</label> <input id="sysUser_dept"
									class="easyui-validatebox easyui-combobox" name="depid"
									data-options="required:true,valueField:'id',textField:'text',url:'/system/department/load_01'"  style="width: 40%;" th:value="${SysUserDto.depid}" readonly="readonly">

							</div>
							</div>
							<br>
								<div class="form-item">
									<label for="" class="label-top">原来密码：</label> <input id="sysUser_oldPassword"
									class="easyui-validatebox easyui-passwordbox" name="oldPassword" iconWidth="28"
									data-options="required:true,showEye: true " style="width: 90%;"
									>
									</div>
									<br>
								<div class="form-item">
									<label for="" class="label-top" >新的密码：</label> <input id="sysUser_newPassword"
									class="easyui-validatebox easyui-passwordbox" name="password" iconWidth="28"
									data-options="required:true,validType: 'length[6,30]',showEye: true " style="width: 90%;"
									>
									</div>
									<br>
								<div class="form-item">
									<label for="" class="label-top" >确认密码：</label> <input id="sysUser_surePassword"
									class="easyui-validatebox easyui-passwordbox" name="" iconWidth="28"
									data-options="required:true,validType: 'length[6,30]',showEye: true " style="width: 90%;"
									>
                    			</div>
					</div>
				</div>
			</div>
					<div style="margin-top: 1%; padding-left: 37.5%">
						<a href="javascript:void(0)" onclick="submitForm()" class="easyui-linkbutton"data-options="iconCls:'fa fa-floppy-o'"style="height: 30px; border-left-width: 1px;">保存</a> 
						<a id="SysUserDtos_close" onclick="closedialog(this)"href="javascript:void(0)" class="easyui-linkbutton"data-options="iconCls:'fa fa-ban'"style="height: 30px; border-left-width: 1px;">取消</a>
					</div>
		</form>
	</div>
<script type="text/javascript">

function submitForm(){
	var newpassword = $("#sysUser_newPassword").val();
	var surepassword = $("#sysUser_surePassword").val();
	if($.trim(newpassword) !=  $.trim(surepassword)) {
		layer.msg('两次输入密码不一样',{icon:5,time:3000});
		return;
	}
	$('#SysUserDtos_form').form('submit',{
		url:'/system/user/save_myself.do',
		onSubmit:function(){
			return $(this).form('enableValidation').form('validate');
		},
		 success: function (data) {
			 if (JSON.parse(data).status ==200) {
				 	break_save();
				 	document.location.href = "/system/logout"
				} else {
						$.messager.alert('消息',JSON.parse(data).msg);
				}
		 }
	});
}
</script>
</body>
</html>